home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9055 < prev    next >
Encoding:
Text File  |  1996-08-05  |  945 b   |  35 lines

  1. Newsgroups: comp.lang.c
  2. Path: bcc.ac.uk!slidel
  3. From: slidel@bsm.bioc.ucl.ac.uk (Timothy Slidel)
  4. Subject: do || die;
  5. Message-ID: <1996Mar7.052636.59812@ucl.ac.uk>
  6. Date: Thu, 7 Mar 1996 05:26:36 GMT
  7. Organization: University College London
  8. X-Newsreader: TIN [version 1.2 PL2]
  9.  
  10. Whilst it seems to work ok - is it considered bad style to use
  11. logical operator expressions as conditional statements on their own, a la
  12. Perl?
  13.  
  14. e.g. if I want to decrement i only when it is != 0:
  15.  
  16. i && i--;
  17.  
  18. clearly something like:
  19.  
  20. i && continue;
  21.  
  22. won't work because continue is a keyword.
  23.  
  24. I couldn't find anything about this in K&R2 or the C-FAQ and gcc -Wall just
  25. issues a warning about an unused value...
  26.  
  27. Thanks.
  28.  
  29. --
  30. Tim Slidel,                                   Email: t.slidel@biochem.ucl.ac.uk
  31. BSM Unit, Biochemistry and Molecular Biology, Tel: +44 171419 3896
  32. University College, Gower Street,             Fax: +44 171380 7193
  33. London WC1E 6BT, United Kingdom.
  34.  
  35.